********************************************************************************
******"Macroprudential Regulation, Quantitative Easing, and Bank Lending"*******
********************************************************************************

********************************************************************************
********************************************************************************
**********************************2019******************************************
********************************************************************************
********************************************************************************
clear *
**# Bookmark (input)
use $inputdirectory/INB_CGP322019

**# Bookmark (input)
merge 1:1 bankid time using $inputdirectory/INB_TP322019, keepus(tradingover)
keep if _merge==3
drop _merge
keep if time==tm(2019m9)

**# Bookmark (input)
merge 1:1 bankid using $inputdirectory/INB_preann2019m8, keepus(e14 exbdisbur exassets)
keep if _merge==3
drop _merge

gen deltablpredover=e14*0.244*exbdisbur/(exassets)

graph drop _all
**# Bookmark (output - panel a - 1)
scatter deltablpredover cgasover if e14>0, mcolor(gray) msize(medium) ytitle("Predicted increase in loan supply, % of assets") xtitle("Capital gain, % of assets", height(5)) legend(off) saving($outputdirectory/FIGIIIFa1, replace)

**# Bookmark (output - panel a - 2)
scatter deltablpredover tradingover if e14>0, mcolor(gray) msize(medium) ytitle("Predicted increase in loan supply, % of assets") xtitle("Trading of securities, % of assets", height(5)) legend(off) saving($outputdirectory/FIGIIIFa2, replace)


********************************************************************************
********************************************************************************
**********************************2015******************************************
********************************************************************************
********************************************************************************
clear *
**# Bookmark (input)
use $inputdirectory/INB_CGP32015

**# Bookmark (input)
merge 1:1 bankid time using $inputdirectory/INB_TP322015, keepus(tradingover)
keep if _merge==3
drop _merge
keep if time==tm(2015m1)

**# Bookmark (input)
merge 1:1 bankid using $inputdirectory/INB_preann2014m12, keepus(e13 exbdisbur exassets)
keep if _merge==3
drop _merge

gen deltablpredover=e13*0.437*exbdisbur/exassets

graph drop _all
**# Bookmark (output - panel b - 1)
scatter deltablpredover cgasover if e13>0, mcolor(gray) msize(medium) ytitle("Predicted increase in loan supply, % of assets") xtitle("Capital gain, % of assets", height(5)) legend(off) saving($outputdirectory/FIGIIIFb1, replace)

**# Bookmark (output - panel b - 2)
scatter deltablpredover tradingover if e13>0, mcolor(gray) msize(medium) ytitle("Predicted increase in loan supply, % of assets") xtitle("Trading of securities, % of assets", height(5)) legend(off) saving($outputdirectory/FIGIIIFb2, replace)



